package com.ruoyi.gybj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gybj.mapper.AlarmRecordsMapper;
import com.ruoyi.gybj.domain.AlarmRecords;
import com.ruoyi.gybj.service.IAlarmRecordsService;

/**
 * 报警记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class AlarmRecordsServiceImpl implements IAlarmRecordsService 
{
    @Autowired
    private AlarmRecordsMapper alarmRecordsMapper;

    /**
     * 查询报警记录
     * 
     * @param id 报警记录主键
     * @return 报警记录
     */
    @Override
    public AlarmRecords selectAlarmRecordsById(Long id)
    {
        return alarmRecordsMapper.selectAlarmRecordsById(id);
    }

    /**
     * 查询报警记录列表
     * 
     * @param alarmRecords 报警记录
     * @return 报警记录
     */
    @Override
    public List<AlarmRecords> selectAlarmRecordsList(AlarmRecords alarmRecords)
    {
        return alarmRecordsMapper.selectAlarmRecordsList(alarmRecords);
    }

    /**
     * 新增报警记录
     * 
     * @param alarmRecords 报警记录
     * @return 结果
     */
    @Override
    public int insertAlarmRecords(AlarmRecords alarmRecords)
    {
        alarmRecords.setCreateTime(DateUtils.getNowDate());
        return alarmRecordsMapper.insertAlarmRecords(alarmRecords);
    }

    /**
     * 修改报警记录
     * 
     * @param alarmRecords 报警记录
     * @return 结果
     */
    @Override
    public int updateAlarmRecords(AlarmRecords alarmRecords)
    {
        alarmRecords.setUpdateTime(DateUtils.getNowDate());
        return alarmRecordsMapper.updateAlarmRecords(alarmRecords);
    }

    /**
     * 批量删除报警记录
     * 
     * @param ids 需要删除的报警记录主键
     * @return 结果
     */
    @Override
    public int deleteAlarmRecordsByIds(Long[] ids)
    {
        return alarmRecordsMapper.deleteAlarmRecordsByIds(ids);
    }

    /**
     * 删除报警记录信息
     * 
     * @param id 报警记录主键
     * @return 结果
     */
    @Override
    public int deleteAlarmRecordsById(Long id)
    {
        return alarmRecordsMapper.deleteAlarmRecordsById(id);
    }
}
